//
//  ESAppearTool.m
//  Eyeshot
//
//  Created by lanou3g on 15/7/11.
//  Copyright (c) 2015年 eyeshot. All rights reserved.
//

#import "ESAppearTool.h"
#import "ESCategoryBar.h"
#import "ESCellBgView.h"
#import "ESDuanziTableCell.h"
#import "ESBaseLabel.h"
@implementation ESAppearTool
+ (void) nightMode {
    
    //TableView设置
    [[UITableViewCell appearance] setBackgroundColor:ESColor(50, 50, 50)];
    //    [[ESDuanziTableCell appearance] setBackgroundColor:ESColor(50, 50, 50)];
    [[UITableView appearance] setBackgroundColor:ESColor(50, 50, 50)];
    [[ESCellBgView appearance] setBackgroundColor:ESColor(60, 60, 60)];
    [[ESBaseLabel appearance] setTextColor:ESColor(150, 150, 150)];
    //     [[ESLabel appearance] setTextColor:[UIColor redColor]];
    [[ESBaseLabel appearance] setBackgroundColor:ESColor(50, 50, 50)];
    
    
    //导航栏设置
    [[ESCategoryBar appearance] setBackgroundColor:ESColor(80, 80, 80)];
    UIImage *nightImage = [UIImage imageWithColor:ESColor(50, 50, 50)];
    [[UINavigationBar appearance] setBackgroundImage:nightImage forBarMetrics:UIBarMetricsDefault];
    
}

+ (void) normalMode {
    [[ESBaseLabel appearance] setBackgroundColor: [UIColor whiteColor]];
    [[ESBaseLabel appearance] setTextColor:[UIColor blackColor]];
    [[UITableView appearance] setBackgroundColor:[UIColor whiteColor]];
    //    [[ESLabel appearance] setTextColor:[UIColor redColor]];
    [[ESCellBgView appearance] setBackgroundColor:[UIColor whiteColor]];
    [[UITableViewCell appearance] setBackgroundColor:ESColor(234, 234, 234)];
    //    [[ESDuanziTableCell appearance] setBackgroundColor:ESColor(234, 234, 234)];
    [[ESCategoryBar appearance] setBackgroundColor:ESAlphaColor(240, 240, 240, 0.3)];
    UIImage *image = [UIImage imageWithColor:ESColor(0, 128, 198)];
    [[UINavigationBar appearance] setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
    
}

+(void)fontSize
{
    NSInteger size = [[NSUserDefaults standardUserDefaults] integerForKey:@"model"];
    switch (size) {
        case 0:
             [[ESBaseLabel appearance] setFont:[UIFont systemFontOfSize:12]];
            break;
        case 1:
             [[ESBaseLabel appearance] setFont:[UIFont systemFontOfSize:15]];
            break;
        case 2:
             [[ESBaseLabel appearance] setFont:[UIFont systemFontOfSize:17]];
            break;
    }
    
}
@end
